package ${package.Controller};

import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import com.wangijun.yuan.admin.base.CommonPage;
import com.wangijun.yuan.admin.base.CommonResult;
import com.wangijun.yuan.core.model.IdParam;
import com.wangijun.yuan.core.model.IdsParam;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import ${wParentName}.model.vo.${entity}VO;
import ${wParentName}.model.dto.${entity}QryParam;
import ${wParentName}.model.dto.${entity}SaveParam;
import ${wParentName}.model.dto.${entity}UpdateParam;

/**
 * <p>
 * ${table.comment!} 前端控制器
 * </p>
 *
 * @author ${author}
 * @since ${date}
 */
@Tag(name = "${table.comment!}接口")
<#if restControllerStyle>
@RestController
<#else>
@Controller
</#if>
@RequestMapping("<#if package.ModuleName?? && package.ModuleName != "">/${package.ModuleName}</#if>/<#if controllerMappingHyphenStyle>${controllerMappingHyphen}<#else>${table.entityPath}</#if>")
<#if kotlin>
class ${table.controllerName}<#if superControllerClass??> : ${superControllerClass}()</#if>
<#else>
<#if superControllerClass??>
public class ${table.controllerName} extends ${superControllerClass} {
<#else>
public class ${table.controllerName} {
</#if>
@Operation(summary = "查", description = "查")
@PostMapping("/list")
CommonResult<CommonPage<${entity}VO>> list(@RequestBody ${entity}QryParam param) {
 return CommonResult.data(null);
 }
 @Operation(summary = "增加", description = "增加")
 @PostMapping("/add")
 CommonResult<Boolean> add(@RequestBody @Validated ${entity}SaveParam param) {
  return CommonResult.data(true);
  }
  @Operation(summary = "ByID获取", description = "ByID获取")
  @PostMapping("/get")
  CommonResult<${entity}VO> add(@RequestBody @Validated IdParam param) {
   return CommonResult.data(null);
   }

   @Operation(summary = "改", description = "改")
   @PostMapping("/update")
   CommonResult<Boolean> update(@RequestBody @Validated ${entity}UpdateParam param) {
    return CommonResult.data(true);
    }
    @Operation(summary = "删", description = "删")
    @PostMapping("/del")
    CommonResult<Boolean> del(@RequestBody IdParam param) {
     return CommonResult.data(true);
     }
     @Operation(summary = "删", description = "删")
     @PostMapping("/delBatch")
     CommonResult<Boolean> delBatch(@RequestBody IdsParam param) {

      return CommonResult.data(true);
      }
}
</#if>
